
$("#file_upload").uploadify({
	buttonText : '选择图片',
	fileTypeExts : '*.png;*.jpg;*.jepg;*.gif',
	'formData' : {
		'cornid' : $("#dnaId").val()
	},
	height : 30,
	swf : $("#basePath").val() + '/uploadify/uploadify.swf',
	uploader : $("#basePath").val() + '/file/upload.form',
	fileObjName : 'file',
	width : 120,
	'auto' : true,
	'multi' : false,
	'onUploadSuccess' : function(file, data, response) {
		alert("上传成功！");
	}
});

/*$(".sss").each(
		function() {
			$(this).tooltip(
					{
						content : "<img src='" + $("#basePath").val()
								+ "/charts/piechart.form?p="
								+ $(this).attr("t") + "&s1="
								+ $(this).attr("s1") + "&s2="
								+ $(this).attr("s2") + "'></img>",
						position : {
							my : "left+20 center-60",
							at : "right center"
						}
					});

		});*/
$(".sss").click(function(){
	 addTab_("showchart","showchart","<img src='" + $("#basePath").val()
				+ "/charts/piechart.form?p="
				+ $(this).attr("t") + "&s1="
				+ $(this).attr("s1") + "&s2="
				+ $(this).attr("s2") + "&s3="
				+ $(this).attr("s3") + "&s4="
				+ $(this).attr("s4") + "'></img>","查看点位图",true,true);
});
$(".chartPic").click(function(){
	 addTab_("showchart","showchart","<img src='" + $("#basePath").val()
				+ "/charts/piechartAll.form?i1="
				+ $(this).attr("i1") + "&i2="+$(this).attr("i2")+"&isexecl="+
				+ $(this).attr("isexecl")+"'></img>","查看点位图",true,true);
	 
	 
});

function viewChart() {

	$('#imgResult').html('图形生成中，请稍候...');

	$.ajax({
		url : $("#basePath").val() + "/ajax.form",
		type : 'POST',
		data : "key=jreechart",
		dataType : 'json',
		async : false,
		contentType : "application/x-www-form-urlencoded; charset=utf-8",
		timeout : 3000,
		error : function(XMLHttpRequest, textStatus, errorThrown) {
			alert('Error ' + XMLHttpRequest + textStatus + errorThrown);
		},
		success : function(result) {
			if (result['url']) {
				$('#imgResult').html("<img src='" + result['url'] + "' />");
			}

		}
	});

}
function listPic(url){	
	addTab("listPic","listPic", $("#basePath").val() + url,"图片列表",true,true);
}